home *** CD-ROM | disk | FTP | other *** search
- I must apologize in advance for the clarity of these docs. Today I feel
- as if English is my second (or Forth, perhaps) language...
-
- I wanted to generate a bouncing ball with DKB and TGAFLI... I tried out
- the excellent ANIMA program by Dan Farmer, but it only allowed me linear
- motion... not sufficient for gravity or collisions. Thus the following
- very rudimentary utilities:
-
- ACCEL: Generate position table.
-
- MRGDATA: Make multiple .DAT files, replacing a variable with line from
- position table.
-
-
- ACCEL SYNTAX:
-
- ACCEL <ScriptFileName> [SkipFrames] > TableName
-
- (ACCEL.EXE writes the position table to standard output).
-
- Since ACCEL is quantized, it is often more accurate to specify a
- multiple number of frames to be calculated for each line emitted. The
- default SkipFrames is 1, or emit for each calculated frame. The same
- number of lines will be emitted regardless of SkipFrame value, but
- the higher the value the more intermediate calculations.
-
-
- ACCEL COMMANDS:
-
-
- ACCELERATION <Magnitude> < x y z direction vector>
-
- Applies a constant acceleration to object in the x y z direction. This
- is good for gravity in a flat world. See ACCEL.BAL.
-
- Set to 0.0 magnitiude for simple velocity and camera dolly.
-
-
- ACCELP <Magnitude> <Radius> < x y z point>
-
- Applies a gravity-like acceleration to the object from a point source
- at X Y Z. The radius is that at which the acceleration is equal to the
- magnitude. You can use this to plot orbits. see ACCEL.ORB.
-
-
- BOUNCEX/BOUNCEY/BOUNCEZ <value> <efficiency>
-
- Reverses the X, Y, or Z velocity vector when the position crosses VALUE
- on the X, Y, or Z axis. Efficiency is a factor reflecting elasticity.
- If it is set to 1.0, all velocity in that direction will be reversed.
- You may have a bounce value for each of the three axes active at once.
- See ACCEL.BAL.
-
-
- FRAMESPERSECOND <value>
-
- Divisor for acceleration changes to velocity and velocity changes to
- position.
-
-
- STARTPOSITION < x y z vector>
-
- Initial position of object, will be first line of output.
-
-
- STARTVELOCITY < x y z vector>
-
- Initial velocity of object.
-
-
- TOTALFRAMES
-
- Number of positions to generate.
-
-
- ACCEL will ignore lines beginning with a semi-colon, so you can
- add comments to your script.
-
-
- MRGDATA SYNTAX:
-
- MRGDATA BaseName VariableName TableName
-
- where BaseName is the base file name of the initial .DAT,
- VaribleName is the Variable to replace (CASE SENSITIVE!), and
- TableName is the file with the variables values.
-
- MRGDATA will create a .DAT for each line in the table. Only one
- variable can be replaced.
-
-
- EXAMPLE:
-
- Using the file ACCEL.SCR:
-
- ACCELERATION 9.8 0.0 -1.0 0.0
- FRAMESPERSECOND 5.0
- TOTALFRAMES 15
- STARTPOSITION 0.0 50.0 0.0
- STARTVELOCITY 0.0 0.0 5.0
- BOUNCEY 0.0 0.9
-
-
- generates a table for a ball dropping from 50.0 units, and bouncing
- on the XZ plane at Y=0.0. 90% of the energy is returned from the
- collision. The ball is initially traveling into the Z direction at
- 5 units/second.
-
- ACCEL ACCEL.SCR > ACCEL.OUT
-
- The resulting table ACCEL.OUT is:
-
- 0.000000 50.000000 0.000000
- 0.000000 48.775000 2.500000
- 0.000000 45.100000 5.000000
- 0.000000 38.975000 7.500000
- 0.000000 30.400000 10.000000
- 0.000000 19.375000 12.500000
- 0.000000 5.900000 15.000000
- 0.000000 0.000000 17.500000
- 0.000000 14.210000 20.000000
- 0.000000 25.970000 22.500000
- 0.000000 35.280000 25.000000
- 0.000000 42.140000 27.500000
- 0.000000 46.550000 30.000000
- 0.000000 48.510000 32.500000
- 0.000000 48.020000 35.000000
-
-
- Now apply the ACCEL.OUT to AT2.DAT (note the variable SphereLoc):
-
- INCLUDE "shapes.dat"
- INCLUDE "colors.dat"
- INCLUDE "textures.dat"
-
- VIEW_POINT
- LOCATION <0.0 20.0 -100.0>
- DIRECTION <0.0 0.0 1.0>
- UP <0.0 1.0 0.0>
- RIGHT <1.33333 0.0 0.0>
- END_VIEW_POINT
-
- OBJECT
- PLANE <0.0 1.0 0.0> -10.0 END_PLANE
- COLOUR White
- TEXTURE
- COLOUR White
- AMBIENT 0.2
- DIFFUSE 0.8
- END_TEXTURE
- END_OBJECT
-
- OBJECT
- SPHERE <SphereLoc> 40.0 END_SPHERE
-
- TEXTURE
- COLOUR Red
- END_TEXTURE
- END_OBJECT
-
- OBJECT
- SPHERE <0.0 0.0 0.0> 2.0 END_SPHERE
- TRANSLATE <100.0 120.0 40.0>
- TEXTURE
- COLOUR White
- AMBIENT 1.0
- DIFFUSE 0.0
- END_TEXTURE
- LIGHT_SOURCE
- COLOUR White
- END_OBJECT
-
-
- The syntax is:
-
- MRGDATA AT2 SphereLoc ACCEL.OUT
-
-
- This generates files AT2001.dat through AT2015.DAT, which have the
- value SphereLoc replaced with the entry from the ACCEL.OUT table.
-
- You can replace any string with the value from the table. If you
- wish to embed spaces in the source string, surround variablename
- with quotes:
-
- MRGDATA AT2 "COLOUR White" ACCEL.OUT
-
-
- MRGDATA will ignore lines beginning with a semi-colon, so you can
- add comments to your table.
-
-
- Remember:
-
- Use the SkipFrames parameter to oversample the motion. This helps
- accuracy, especially in the bounces. (Bounces force the object to
- the bounce value, and so the resulting velocity may be too great for
- that location. In the example above, the ball bounced back with more
- than 90% of its energy because of quantization error).
-
-
- ...John M. Trindle, June 1991
- (you can reach me on "You can call me Ray")
-